<?php

/**
 * Transaction form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseTransactionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'transaction_id'        => new sfWidgetFormInputHidden(),
      'invoice_id'            => new sfWidgetFormPropelChoice(array('model' => 'Invoice', 'add_empty' => true)),
      'card_number'           => new sfWidgetFormInput(),
      'card_exp_month'        => new sfWidgetFormInput(),
      'card_exp_year'         => new sfWidgetFormInput(),
      'card_type'             => new sfWidgetFormInput(),
      'payment_type'          => new sfWidgetFormInput(),
      'trans_amount'          => new sfWidgetFormInput(),
      'status'                => new sfWidgetFormInput(),
      'current_auth_response' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'transaction_id'        => new sfValidatorPropelChoice(array('model' => 'Transaction', 'column' => 'transaction_id', 'required' => false)),
      'invoice_id'            => new sfValidatorPropelChoice(array('model' => 'Invoice', 'column' => 'invoice_id', 'required' => false)),
      'card_number'           => new sfValidatorNumber(array('required' => false)),
      'card_exp_month'        => new sfValidatorNumber(array('required' => false)),
      'card_exp_year'         => new sfValidatorNumber(array('required' => false)),
      'card_type'             => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'payment_type'          => new sfValidatorInteger(array('required' => false)),
      'trans_amount'          => new sfValidatorNumber(array('required' => false)),
      'status'                => new sfValidatorInteger(array('required' => false)),
      'current_auth_response' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('transaction[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Transaction';
  }


}
